export function eliminateLine(map) {
  const lines = getFullLines(map);
  if (lines.length > 0) {
    let oldfen = document.getElementById('woshifenshu').innerText
    document.getElementById('woshifenshu').innerText = Number(oldfen)  + lines.length
  }
  const mapCol = map[0].length;
  for (let i = 0; i < lines.length; i++) {
    map.splice(lines[i], 1);
    const arr = new Array(mapCol).fill(0);
    map.unshift(arr);
  }
}

export function getFullLines(map) {
  const row = map.length;
  const r = [];
  for (let i = 0; i < row; i++) {
    const boo = map[i].every((v) => {
      return v === -1;
    });
    if (boo) {
      r.push(i);
    }
  }
  return r;
}
